const http = require('../utils/http')

const HTTP = new http.HTTP()

// 查我加入的活动
export function getMyActivity(userId, pageNum, pageSize, callback) {
    let params = {
        userId,
        pageNum,
        pageSize
    }
    HTTP.request('/activity/all/' + userId, 'GET', params, res => {
        callback(res)
    })
}

export function activitySignInByActivityId(
    activityId,
    volunteerId,
    callback
) {
    HTTP.request('/activity/signIn/' + activityId, 'PUT', {
        activityId,
        volunteerId
    }, res => {
        callback(res)
    })
}
export function activitySignOut(
    activityId,
    volunteerId,
    callback
) {
    HTTP.request('/activity/signOut/' + activityId, 'PUT', {
        activityId,
        volunteerId
    }, res => {
        callback(res)
    })
}

export function activityAllWaitingForStart(callback) {
    HTTP.request('/activity/all/waitingForStart', 'GET', {}, res => {
        callback(res)
    })
}

export function activityAllActivities(callback) {
    HTTP.request('/activity/allActivities', 'GET', {}, res => {
        callback(res)
    })
}
export function activityGetLeaveInfo(activityId, callback) {
    HTTP.request('/activity/getLeaveInfo/' + activityId, 'GET', {}, res => {
        callback(res)
    })
}
export function activityGetMyActivities({
    pageNum,
    pageSize
},callback) {
    let params = {
        pageNum,
        pageSize
    }
    HTTP.request('/activity/getMyActivities', 'GET', params, res => {
        callback(res)
    })
}
